<template>
  <el-dialog :title="'退款单'" :close-on-click-modal="false" :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width="1000px">
    <el-row :gutter="15" class="">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules">
        <el-col :span="12">
          <el-form-item label="客户名称" >
            <el-autocomplete v-model="dataForm.customerName" disabled
                             :fetch-suggestions="querySearchSchoolAsync" placeholder="请选择客户"
                             :style="{ width: '100%' }" @select="handleSelectCustomer">
              <template slot-scope="{ item }">
                <div class="name">{{ item.name }}</div>
              </template>
            </el-autocomplete>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="收款品牌" >
            <el-select v-model="dataForm.brand" placeholder="请选择收款品牌" clearable required :style="{ width: '100%' }" disabled>
              <el-option v-for="(item, index) in brandOptions" :key="index" :label="item.fullName" :value="item.enCode"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="招商经理" >
            <el-select v-model="dataForm.managerId" placeholder="请选择招商经理" clearable required :style="{ width: '100%' }" disabled>
              <el-option :key="item.id" :label="item.realName" :value="item.id" v-for="item in managerIdOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="加盟费" >
            <el-input v-model="dataForm.franchiseFee" placeholder="请输入加盟费" clearable required :style="{ width: '100%' }" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="已收款金额">
            <el-input v-model="dataForm.amount" placeholder="请输入已收款金额" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-row></el-row>
        <el-col :span="12">
          <el-form-item label="退款金额" prop="amount">
            <el-input v-model="dataForm.amount" placeholder="请输入退款金额" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款日期" prop="paymentDate">
            <el-date-picker v-model="dataForm.paymentDate" placeholder="请选择退款日期" clearable required :style="{ width: '100%' }" type="datetime" format="yyyy-MM-dd" value-format="timestamp"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款方式" prop="paymentMethod">
            <el-select v-model="dataForm.paymentMethod" placeholder="请选择退款方式" clearable required :style="{ width: '100%' }">
              <el-option v-for="(item, index) in methodOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="退款凭证" prop="screenshot">
            <custom-upload-img v-model="dataForm.screenshot" :fileSize="5" sizeUnit="MB" :limit="9"></custom-upload-img>
          </el-form-item>
        </el-col>

      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from './index.js'
</script>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
@import url(index.scss);
</style>
